///:User.java
package com.cqgcxy.stranger.domain;

import java.io.Serializable;

/**
 * @author icechen1219
 * @date 2018/11/20
 */
public class User implements Cloneable, Serializable {
    private Integer id;
    private String name;
    private Integer age;

    public User(){
        System.out.println("One object of User.class is creating...");
    }

    /**
     * 方便测试用的创建对象的静态方法
     * @param i
     * @return
     */
    public static User createUser(int i) {
        User tmp = new User();
        tmp.setId(i);
        tmp.setName("" + i);
        tmp.setAge(i % 100);
        return tmp;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public User clone() throws CloneNotSupportedException {
        return (User) super.clone();
    }
}
///:User.java
